bitkeeper revision 1.1518 (42923748Z36fQ-pX8ugPi-8ioexnOg)
authorbren@br260.wolfson.cam.ac.uk <bren@br260.wolfson.cam.ac.uk>
Mon, 23 May 2005 20:04:24 +0000 (20:04 +0000)
committerbren@br260.wolfson.cam.ac.uk <bren@br260.wolfson.cam.ac.uk>
Mon, 23 May 2005 20:04:24 +0000 (20:04 +0000)
Add ethtools support to turn on/off Tx checksum offloading in
the netfront driver.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
linux-2.6.11-xen-sparse/drivers/xen/netfront/netfront.c

index d8a14d2319b295fb3f27a8ec74ce5699e2737103..b7dbbd151f4c9325a894f1492b6e3020334f7ce4 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/init.h>
 #include <linux/bitops.h>
 #include <linux/proc_fs.h>
+#include <linux/ethtool.h>
 #include <net/sock.h>
 #include <net/pkt_sched.h>
 #include <net/arp.h>
@@ -928,6 +929,11 @@ vif_connect(struct net_private *np, netif_fe_interface_status_t *status)
     vif_show(np);
 }
 
+static struct ethtool_ops network_ethtool_ops =
+{
+    .get_tx_csum = ethtool_op_get_tx_csum,
+    .set_tx_csum = ethtool_op_set_tx_csum,
+};
 
 /** Create a network device.
  * @param handle device handle
@@ -973,6 +979,8 @@ static int create_netdev(int handle, struct net_device **val)
     dev->weight          = 64;
     dev->features        = NETIF_F_IP_CSUM;
 
+    SET_ETHTOOL_OPS(dev, &network_ethtool_ops);
+
     if ((err = register_netdev(dev)) != 0) {
         printk(KERN_WARNING "%s> register_netdev err=%d\n", __FUNCTION__, err);
         goto exit;